/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.modules.sys.entity.Office;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 收款单Entity
 * @author weisong
 * @version 2017-09-22
 */
public class Bill extends DataEntity<Bill> {
	
	private static final long serialVersionUID = 1L;
	//收款单状态
	public static final int updateStatus1 = 2;		//部分核销
	public static final int updateStatus2 = 3;		//全部核销
	public static final int updateStatus3 = 1;		//已确认
	public static final String noDetail = "noDetail";        //新增核销单时手动输入的付款金额，收款金额在引入明细时不可改变
	public static final String haveDetail = "haveDetail";        //新增核销单时直接引入明细，收款金额是累加引入的明细汇总值，明细改变，收款金额重新累加
	private String billNo;		// 收款单号
	private Date billDate;		// 收款日期
	private Integer status;		// 状态
	private Consignor payerName;		// 结算方
	private Double billMoney;		// 收款金额
	private Integer payMethod;		// 支付方式
	private String operateType;		// 操作类型
	private Office logistics;		// 物流组织
	
	public Bill() {
		super();
	}

	public Bill(String id){
		super(id);
	}

	@ExcelField(title="收款单号", align=2, sort=6)
	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="收款日期不能为空")
	@ExcelField(title="收款日期", align=2, sort=7)
	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}
	
	@NotNull(message="状态不能为空")
	@ExcelField(title="状态", dictType="bill_status", align=2, sort=8)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@NotNull(message="结算方不能为空")
	@ExcelField(title="结算方", fieldType=Consignor.class, value="", align=2, sort=9)
	public Consignor getPayerName() {
		return payerName;
	}

	public void setPayerName(Consignor payerName) {
		this.payerName = payerName;
	}
	
	@ExcelField(title="收款金额", align=2, sort=10)
	public Double getBillMoney() {
		return billMoney;
	}

	public void setBillMoney(Double billMoney) {
		this.billMoney = billMoney;
	}
	
	@NotNull(message="支付方式不能为空")
	@ExcelField(title="支付方式", dictType="pay_method_type", align=2, sort=11)
	public Integer getPayMethod() {
		return payMethod;
	}

	public void setPayMethod(Integer payMethod) {
		this.payMethod = payMethod;
	}
	
	@ExcelField(title="操作类型", align=2, sort=12)
	public String getOperateType() {
		return operateType;
	}

	public void setOperateType(String operateType) {
		this.operateType = operateType;
	}
	
	@ExcelField(title="物流组织", fieldType=Office.class, value="logistics.name", align=2, sort=13)
	public Office getLogistics() {
		return logistics;
	}

	public void setLogistics(Office logistics) {
		this.logistics = logistics;
	}
	
}